5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
- Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 4-6: ILF Keyword Reference

IF


The IF statement compares the contents of two fields, or compares the contents of a field with a constant, and sets the next level of the internal true/false flag.

  ?????   IF      ??? ?????????????????????? ??? ?? ??? ?????????????????????? ???
  (1)             (2) (3)                    (4) (5)(6) (7)                    (8)

(1) T/F execution conditions
(2) 1st application ID
(3) 1st field name or PDF
(4) 1st occurrence (constant/index)
(5) Relation (LT,GT,LE,GE,EQ,NE,IN,EX, RI, RS)
(6) 2nd application ID
(7) 2nd field name, PDF, or constant
(8) 2nd occurrence (constant/index)

Sets True/False Status Indicator

In comparing the contents of two fields, or a field with a constant, the next level of the true/false status indicators is set to T if the condition is true, or F if the condition is false. See True/False Status Indicators for details on using these indicators.

Using the Statement

The IF statement specifies a relationship between two values. The valid relational operators are:

less than (LT), greater than (GT), less than or equal to (LE), greater than or equal to (GE) equals (EQ), not equal to (NE), includes (IN), excludes (EX), regular expression case insensitive (RI) and regular expression case sensitive (RS) .

The relation IN means 'includes'. The relation is true if the value in the second field is included in the first field, and false otherwise. If the relation is true, the predefined field TEXT AT POSITION is set to the starting position of the second field within the first field. The first field must be an alpha field; the second can be either an alpha field or a constant. Trailing blanks are ignored if the second field is a constant; however, you may specify fixed spaces (by entering underscores) to include one or more trailing spaces as part of a character string that is being searched.

RI and RS require a search string in the 2nd field name.  The syntax of the search string may depend on the operating system where Appx is installed.  Consider the following examples.  All will check for 9 digits in the TEMP 30 field.  All of these IF statements will work on a Windows server, but only the first (using character groups) or last (using Posix character classes) will work on Linux.

          IF   --- TEMP 30                        RI      ^[0-9]{9}$
          IF   --- TEMP 30                        RI      ^\d{9}$
          IF   --- TEMP 30                        RI      ^[[:digit:]]{9}$

 

Restrictions

The IF statement supports comparisons between like data types only (alpha-to-alpha, numeric-to-numeric, date-to-date, logic-to-logic). When comparing two date fields, results can be unpredictable if you are using a date field without a century component. Confirm that your System Administrator has set up the Pivot Year environment variable to avoid unexpected results.

Related PDFs

TEXT AT POSITION

Related Statements

AND, OR

Example

In this example, if the customer's balance is greater than his credit limit, an error message is given and the balance field blinks; otherwise, no action is taken. 

          IF   TAR CUSTOMER BALANCE             GT TAR CUSTOMER CREDIT LIMIT
  T       ERROR    Customer's balance exceeds credit limit!
  T       BLINK    TAR CUSTOMER BALANCE

Application Design Manual                                         "Powered by Appx Software"

652

©2006 By APPX Software, Inc. All Rights Reserved